import React from 'react';
import MusicListItem  from './MusicListItem.js';
import Player from './Player.js';
import { Link } from 'react-router';


class MusicList extends React.Component{
	render(){
		var musicList=this.props.musicList;
		var musicListItems=[];
		var currentMusicItem=this.props.currentMusicItem;
		musicList.forEach(function(value,index){
			musicListItems.push(<MusicListItem key={musicList[index].id}
				musicListItem={musicList[index]}
				focus={musicList[index]===currentMusicItem} />);
		});
		var styles={
				padding:'0'
			};
		var link={
			position:'fixed',
			top:'15px',
			right:'15px',
			color:'#000',
			fontSize:'20px',
			fontFamily:'微软雅黑'
		};
		return (
			<ul style={styles}>
			 {musicListItems}
			 <Link to={Player} style={link}>返回</Link>
			</ul>
			);
	}
}


MusicList.defaultProps={};

export default MusicList;